import re

if __name__ == '__main__':
    text = 'This is some text -- with punctuation.'
    pattern = 'is'

    print('Text   :', text)
    print('Pattern:', pattern)

    match = re.search(pattern=pattern, string=text)
    if match is not None:
        s = match.start()
        e = match.end()
        print(s, e)
    else:
        print("search 无结果")

    match = re.match(pattern=pattern, string=text)
    if match is not None:
        s = match.start()
        e = match.end()
        print(s, e)
    else:
        print("match 无结果")

    match = re.fullmatch(pattern=pattern, string=text)
    if match is not None:
        s = match.start()
        e = match.end()
        print(s, e)
    else:
        print("fullmatch 无结果")